﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using Data;

namespace Bussiness
{
    public static class manejadorCliente
    {
        public static void RegistrarNuevoCliente(cliente c)
        {
            ClienteDataAccess hDal = new ClienteDataAccess();

            if (hDal.existeCliente(c.nDocumento) == false)
            {
                try
                {
                    hDal.registrarCliente(c);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
                throw new Exception("El cliente ya existe");

        }



        public static void ModificarCliente(cliente c)
        {
            ClienteDataAccess hDal = new ClienteDataAccess();
            try
            {
                hDal.modificarCliente(c);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
